<script type="text/javascript">
 
	$('#PageRefresh').click(function() {
 
    	      location.reload();
 
	});
 
</script>

<table class="downloads">
      <tr class="title">
  		<td align="left">Lien</td>
  		<td>Titre</td>
  		<td  align="left">Trailer</td>
  		<td>Taille</td>
  		<td>Nb DL</td>
  		<?php 
  		if ($sf_user->isAuthenticated())
    	{
     		echo "<td>Ajouter</td>
     			  <td>Modifier</td>
     			  <td>Supprimer</td>
     			  <td>Signaler</td>";
   		}
  		?>
  		
  	</tr>
 <?php foreach ($filys as $i => $fily): ?>  
 	<?php foreach($fily->Links as $j =>$link):?>       
        <tr class="<?php echo fmod($i, 2) ? 'even' : 'odd' ?>">
           <td>
            
            
            <a id="PageRefresh" href="<?php echo url_for('nbview', $fily->Links[$j]) ?> " target= "_blank">MU</a>
            </td>
            <td class="title">
            
              <?php echo link_to($fily->getLabel(), 'download_show', $fily) ?>
             
            </td>

            <td  class="">
            <a href="<?php echo url_for($fily->getTrailer()) ?> " target= "_blank">YT</a>
            
            </td>
            <td class="size">
            <?php echo $fily->Links[$j]->size ?>
            </td>
            <td>
            <?php echo $fily->Links[$j]->nb_download ?></td>
            <?php 
  			if ($sf_user->isAuthenticated())
    		{
     			echo "<td align='center'>".link_to('+', 'addlink', $fily)."</td>
     				  <td align='center'><a href=".url_for('downloadlink_edit', $fily->Links[$j]).">M</a></td>
     				  <td align='center'>".link_to('D', 'delink', $fily->Links[$j],array('method' => 'get', 'confirm' => 'Supprimer?'))."</td>
     				  <td align='center'>".link_to('D', 'signlink', $fily->Links[$j],array('method' => 'get', 'confirm' => 'Signaler?'))."</td>";
   			} ?>
  			
   			 
        </tr>
         <?php endforeach; 
   			 endforeach; ?>
        
      </table>